<?php $this->headLink()->appendStylesheet('css/jquery.alerts.css'); ?>
<?php $this->headLink()->appendStylesheet('css/jquery.selectbox.css'); ?>
<?php $this->headLink()->appendStylesheet('css/jquery.tipsy.css'); ?>

<?php $this->headScript()->appendFile('js/jquery.sparkbox-select.js'); ?>
<?php $this->headScript()->appendFile('js/jquery.alerts.js'); ?>
<?php $this->headScript()->appendFile('js/jquery.tipsy.js'); ?>

<script type="text/javascript">
	$(document).ready(function(){
		$('#quick_action_btn').click(function(){
			if (parseInt($('#quick_actions').val()) > 0) {
				$('#quick_action').val($('#quick_actions').val());
				$('#admin_listing_frm').submit();
			}
			return false;
		});

		$(".sparkbox-custom").sbCustomSelect();

		$('#item_select').click(function(){
			if ($(this).attr('checked'))
				bAllSelected = false;
			else
				bAllSelected = true;
			selectAll();
		});

		$.alerts.overlayOpacity = 0.6;
		$.alerts.okButton = "&nbsp;Da&nbsp;";
		$.alerts.cancelButton = "&nbsp;Nu&nbsp;";

		$('.sterge_bott').click(function(){
			var obj = this;
			jConfirm("Sunteti sigur ca vreti sa stergeti?", "Sterge item", function(r){
				if (r) {
					window.location = $(obj).attr('href');
				}
			});
			return false;
		});

		$('a.editeaza_bott').tipsy({
			html: true,
			gravity: 's',
			fallback: 'Editeaza'
		});
		$('a.sterge_bott').tipsy({
			html: true,
			gravity: 's',
			fallback: 'Sterge'
		});

		$('#listing_sort_order_btn').click(function(){
			$('#do_sort_order').val(1);
			$('#admin_listing_frm').submit();
			return false;
		});
	});
</script>
<div class="content">
	<div class="content_midd">
		<div class="fix_20"></div>
		<div class="bara_submeniu">
			<div class="bara_submeniu_midd">
				<div class="fix_15"></div>
				<h1 class="float_left" style="width: 60%;"><?php echo $this->translate('Tip apa'); ?></h1>
				<div class="float_right" style="width: 40%;">
					<div class="fix"></div>
						<a href="<?php echo $this->url(array('action' => 'watertype')); ?>" class="botton2 float_right"><?php echo $this->translate('Listeaza'); ?></a>
						<a href="<?php echo $this->url(array('action' => 'save')); ?>" class="botton2 float_right" style="margin-right: 10px"><?php echo $this->translate('Add'); ?></a>
					</div>
				<div class="fix_15"></div>
			</div>
		</div>

		<?php $this->headScript()->appendFile('js/admin/listing_filters.js'); ?>
		<div class="fix_20"></div>
		<form method="post" id="admin_listing_filter">
			<input type="hidden" name="do_filter" value="1">
			<input type="hidden" id="reset_filter" name="reset_filter" value="0">
			<table width="100%" border="0" class="shadow">
				<tr>
					<td width="49%" valign="top">
						<strong><a href="#" id="filter_btn" class="filtre_icon filtre_icon_select">Filtre</a></strong>
						<div class="fix_5"></div>
						<div id="filter_block" style="display: none;">
							<img src="media/images/admin/sep.gif"  alt="" />
							<div class="fix_10"></div>
							<!--
							<table class="ul_def_li " width="100%" >
								<tr>
									<td width="34%">
										<input type="checkbox" value="ident" onclick="toggleFilter('ident');" name="fields[]" id="cb_ident">
										<label for="cb_ident">Identificator</label>
									</td>
									<td width="33%">
										<select onchange="toggleOperator('ident');" name="operators[ident]" id="operators_ident" class="select-small ob_ident">
											<option value="~">contine</option>
											<option value="!~">nu contine</option>
										</select>
									</td>
									<td width="33%">
										<div class="ob_ident" id="div_values_ident">
											<input type="text" size="30" name="values[ident]" id="values_ident" class="select-small" value="">
										</div>
									</td>
								</tr>
							</table>
							-->
							<table class="ul_def_li " width="100%" >
								<tr>
									<td width="34%">
										<input type="checkbox" value="name" onclick="toggleFilter('name');" name="filter[fields][]" id="cb_name">
										<input type="hidden" value="text" name="filter[type][name]">
										<label for="cb_name">Nume</label>
									</td>
									<td width="33%">
										<select onchange="toggleOperator('name');" name="filter[operators][name]" id="operators_name" class="select-small ob_name">
											<option value="~">contine</option>
											<option value="!~">nu contine</option>
										</select>
									</td>
									<td width="33%">
										<div class="ob_name" id="div_values_name">
											<input type="text" size="30" name="filter[values][name]" id="values_name" class="select-small" value="">
										</div>
									</td>
								</tr>
							</table>
							<!--
							<table class="ul_def_li " width="100%" >
								<tr>
									<td width="34%">
										<input type="checkbox" value="content" onclick="toggleFilter('content');" name="fields[]" id="cb_content">
										<label for="cb_content">Continut</label>
									</td>
									<td width="33%">
										<select onchange="toggleOperator('content');" name="operators[content]" id="operators_content" class="select-small ob_content">
											<option value="~">contine</option>
											<option value="!~">nu contine</option>
										</select>
									</td>
									<td width="33%">
										<div class="ob_content" id="div_values_content">
											<input type="text" size="30" name="values[content]" id="values_content" class="select-small" value="">
										</div>
									</td>
								</tr>
							</table>
							-->
							<table class="ul_def_li " width="100%" >
								<tr>
									<td width="34%">
										<input type="checkbox" value="status" onclick="toggleFilter('status');" name="filter[fields][]" id="cb_status">
										<input type="hidden" value="arr" name="filter[type][status]">
										<label for="cb_status">Status</label>
									</td>
									<td width="33%">
										<select onchange="toggleOperator('status');" name="filter[operators][status]" id="operators_status" class="select-small ob_status">
											<option value="*">toate</option>
											<option value="=">este</option>
											<option value="!">nu este</option>
										</select>
									</td>
									<td width="33%">
										<div class="ob_status hidden" id="div_values_status">
											<select class="select-small" id="values_status" name="filter[values][status][]">
												<option value="0">Inactiv</option>
												<option value="1">Activ</option>
											</select>
											<a style="vertical-align: bottom;" onclick="toggleMultiSelect('status'); return false;" href="javascript: void(0);"><img src="media/images/admin/icons/bullet_toggle_plus.png" alt="Bullet_toggle_plus"></a>
										</div>
									</td>
								</tr>
							</table>
						</div>
					</td>
					<td width="2%"> &nbsp; </td>
					<td width="49%" valign="top">
						<strong><a href="#" id="options_btn" class="filtre_icon filtre_icon_select">Optiuni</a></strong>
						<div class="fix_5"></div>
						<div id="options_block" style="display: none;">
							<img src="media/images/admin/sep.gif"  alt="" />
							<div class="fix_10"></div>
							<select multiple="multiple" name="available_columns[]" id="available_columns" size="5" style="width: 190px; margin-right: 10px;" class="float_left">
								<option value="id">ID</option>
								<!-- <option value="content">Continut</option> -->
							</select>
							<div class="float_left">
								<div class="fix_15"></div>
								<a href="#" id="move_right"><img src="media/images/admin/icons/sel_1.gif" alt="" /></a>
								<div class="fix_5"></div>
								<a href="#" id="move_left"><img src="media/images/admin/icons/sel_2.gif" alt="" /></a>
							</div>
							<select multiple="multiple" name="options[selected_columns][]" id="selected_columns" size="5" style="width: 190px; margin-left: 10px;" class="float_left">
								<!-- <option value="ident">Identificator</option> -->
								<option value="name">Nume</option>
								<option value="status">Status</option>
							</select>
							<div class="float_left" style="margin-left: 5px;">
								<div class="fix_10"></div>
								<a href="#" id="move_up"><img src="media/images/admin/icons/sel_up.gif" alt="" /></a>
								<div class="fix_5"></div>
								<a href="#" id="move_down"><img src="media/images/admin/icons/sel_down.gif" alt="" /></a>
							</div>
						</div>
					</td>
				</tr>
			</table>
			<div class="fix_10"></div>
			<div class="back_gri">
				<div class="fix_10"></div>
				<a href="#" id="filter_cancel_btn" class="botton_red float_right" style="margin-left: 10px; margin-right: 10px;">Reset</a>
				<a href="#" id="filter_submit_btn" class="botton_green float_right">Salveaza</a>
				<div class="fix_10"></div>
			</div>
		</form>

		<div class="fix_10"></div>
		<div class="float_left">
			<div class="position_relative float_left" style="margin-right: 10px;">
				<select id="quick_actions" class="sparkbox-custom">
					<option><?php echo $this->translate('Alege ...'); ?></option>
					<option value="1"><?php echo $this->translate('Inactiv'); ?></option>
					<option value="2"><?php echo $this->translate('Activ'); ?></option>
				</select>
			</div>
			<a href="#" id="quick_action_btn" class="botton float_left"><?php echo $this->translate('Opereaza'); ?></a>
		</div>
		<div class="float_right">
			<?php echo $this->paginationControl($this->paginator,
                                    'Sliding',
                                    'admin/admin_pagination.phtml'); ?>
		</div>
		<div class="fix_10"></div>
		<form name="admin_listing" id="admin_listing_frm" method="post">
			<input type="hidden" name="do_action" value="1">
			<input type="hidden" name="do_sort_order" id="do_sort_order" value="0">
			<input type="hidden" name="str_sort_order" id="str_sort_order" value="">
			<input type="hidden" name="quick_action" id="quick_action" value="">
			<table border="0" class="tab_lista shadow" id="item_listing">
				<thead>
					<tr class="nodrop nodrag">
						<td class="headrt_tab" width="58"><strong><?php echo $this->translate('Editeaza'); ?></strong></td>
						<td class="headrt_tab" width="12"><input type="checkbox" id="item_select" /></td>
						<td class="headrt_tab"><strong><a href="<?php echo $this->url(array('set' => 'order', 'field' => 'name')); ?>" class="sageata_sus"><?php echo $this->translate('Name'); ?></a></strong></td>
						<td class="headrt_tab"><strong><a href="<?php echo $this->url(array('set' => 'order', 'field' => 'status')); ?>" class="sageata_sus"><?php echo $this->translate('Status'); ?></a></strong></td>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($this->paginator as $item) { ?>
					<tr>
						<td class="tab_alb" style="padding: 0px;">
							<a href="<?php echo $this->url(array('action' => 'save', 'id' => $item->getId())); ?>" class="editeaza_bott">&nbsp;</a>
							<a href="<?php echo $this->url(array('action' => 'delete', 'id' => $item->getId())); ?>" class="sterge_bott">&nbsp;</a>
						</td>
						<td class="tab_alb"><input type="checkbox" name="action_item[]" class="action_item" value="<?php echo $item->getId(); ?>" /></td>
						<td class="tab_alb"><?php echo $item->getName(); ?></td>
						<td class="tab_alb">
							<?php /*switch ($item->getStatus()) {
								case Application_Model_WaterType::STATUS_INACTIVE: echo '<strong class="inactiv">'.$this->translate('Inactiv').'</strong>'; break;

								case Application_Model_WaterType::STATUS_ACTIVE:
								default: echo '<strong class="activ">'.$this->translate('Activ').'</strong>'; break;
							} */ ?>
						</td>
					</tr>
					<?php } ?>
				</tbody>
			</table>
			<div class="back_gri2">
				<div class="fix_10"></div>
				<a href="#" id="listing_sort_order_btn" class="botton float_right"  style="margin-left: 10px; margin-right: 10px;">Salveaza</a>
				<div class="fix_10"></div>
			</div>
		</form>
		<div class="fix_30"></div>
	</div>
</div>